#pragma once


// types of collision filters
enum EPhysFilterTypes 
{
	ePhysFilterNone				= 0x0,
	ePhysFilterStatic			= 0x1,
	ePhysFilterRigidBody		= 0x2,
	ePhysFilterKinematic		= 0x4,
	ePhysFilterCamera			= 0x8,
	ePhysFilterZone				= 0x10,
	ePhysFilterBasicBodies		= ePhysFilterRigidBody | ePhysFilterStatic | ePhysFilterKinematic,
	ePhysFilterDynamicBodies	= ePhysFilterRigidBody | ePhysFilterKinematic,
	ePhysFilterEnviroment		= ePhysFilterCamera | ePhysFilterStatic,
	ePhysFilterDefaultGroup		= ePhysFilterRigidBody | ePhysFilterCamera,
	ePhysFilterDefaultMask		= ePhysFilterBasicBodies | ePhysFilterZone,

	eMaxPhysFilterType
};

//! enum of geometry tryps
enum EPhysGeomType
{
	ePhysGeomTypeInvalid		= 0, // invalid or not initialized
	ePhysGeomTypeBox			= 1,
	ePhysGeomTypeSphere			= 2,
	ePhysGeomTypeCylinder		= 3,
	ePhysGeomTypeCapsule		= 4,
	ePhysGeomTypeCone			= 5,
	ePhysGeomTypeStaticPlane	= 6,
	ePhysGeomTypeConvexMesh		= 7,
	ePhysGeomTypeConcaveMesh	= 8,
	ePhysGeomTypeBBoxFromNode	= 9,

	eMaxPhysGeomType // must be last
};
//! container for geometry params
class IrrPhysGeomParams
{
 public:
	EPhysGeomType				m_ePhysGeomType;
	irr::scene::ISceneNode*		m_poSceneNode;
	bool						m_bAutoCalculate;
	//=== constructor ===//
	IrrPhysGeomParams()
		: m_ePhysGeomType(ePhysGeomTypeInvalid)
		, m_poSceneNode(0)
		, m_bAutoCalculate(1)
	{
		// empty
	}

	class IrrPhysSphereGeom
	{
	public:
		irr::f32				m_f32Radius;             //! sphere radius
		//=== constructor ===//
		IrrPhysSphereGeom()
			: m_f32Radius(1.0f)
		{
			// empty
		}
	}SphereParams;

	class IrrPhysBoxGeom
	{
	public:
		//=== constructor ===//
		IrrPhysBoxGeom()
			: X(1.0f)
			, Y(1.0f)
			, Z(1.0f)
		{
			// empty
		}
		irr::f32 X;		//! box width HalfExtent
		irr::f32 Y;		//! box length HalfExtent
		irr::f32 Z;		//! box height HalfExtent
	}BoxParams;

	class IrrPhysMeshGeom
	{
	public:
		//=== constructor ===//
		IrrPhysMeshGeom()
			: m_poIrrMesh(0)
		{
			// empty
		}
		irr::scene::IMesh* m_poIrrMesh;  //! mesh interface
	}MeshParams;
};

//! physics parameters
class IrrPhysImpulseParams
{
	//=== constructors ===//
	IrrPhysImpulseParams() 
		: m_f32Mass(1.0f)
		, m_f32CcdThreshold(0.0f)
		, m_f32LinearDamping(0.0f)
		, m_f32AngularDamping(0.0f)
		, m_f32Friction(0.0f)
		, m_f32Restitution(0.0f)
		, m_bFilterEnabled(false) 
		, m_s16FilterGroup(0)
		, m_s16FilterMask(0)
		, m_iCollisionReportMask(0)
		, m_iCollisionObject(0)
	{
		// empty
	}

	irr::f32				m_f32Mass;
	irr::f32				m_f32CcdThreshold;
	irr::f32				m_f32LinearDamping;
	irr::f32				m_f32AngularDamping;
	irr::f32				m_f32Friction;
	irr::f32				m_f32Restitution;
	irr::core::vector3df	m_v3fCenterOfMassOffset;
	short					m_s16FilterGroup;
	short					m_s16FilterMask;
	int						m_bFilterEnabled;
	int						m_iCollisionReportMask;
	int						m_iCollisionObject;
};
